<template>
  <!-- 明细页面弹出框-->
  <el-dialog
    :title="isNets ? '轧差排队管理申请录入明细' : '清算排队管理申请录入明细'"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="126px" :disabled="true">
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="交易流水号：" prop="id">
            <el-input v-model="formData.id" placeholder="交易流水号" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="报文标识号：" prop="pkgId">
            <el-input v-model="formData.pkgId" placeholder="报文标识号" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="CPG日期：" prop="vdate">
            <el-date-picker
              v-model="formData.vdate"
              type="date"
              value-format="yyyyMMdd"
              placeholder="选择日期"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="工作日期：" prop="workdate">
            <el-date-picker
              v-model="formData.workdate"
              type="date"
              value-format="yyyyMMdd"
              placeholder="选择日期"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="被查询行：" prop="inqStBrno">
            <el-input v-model="formData.inqStBrno" placeholder="被查询行" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="排队业务数目：" prop="totalNum">
            <el-input v-model="formData.totalNum" placeholder="排队业务数目" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="申请时间：" prop="sndTime">
            <el-date-picker
              v-model="formData.sndTime"
              type="datetime"
              value-format="yyyyMMddHHmmss"
              placeholder="选择日期"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item v-if="isNets" label="通讯状态：" prop="rcvType">
            <el-select v-model="formData.rcvType" placeholder="通讯状态" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PKG_STATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item v-else label="查询方式：" prop="inqType">
            <el-select v-model="formData.inqType" placeholder="查询方式" style="width: 100%">
              <el-option
                v-for="dict in dictMap.CLS_QUERYTYPE"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" v-if="!isNets">
        <el-col :span="12">
          <el-form-item label="通讯状态：" prop="rcvType">
            <el-select v-model="formData.rcvType" placeholder="通讯状态" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PKG_STATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="中心状态：" prop="procStatus">
            <el-select v-model="formData.procStatus" placeholder="中心状态" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PROCESSSTATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex" v-if="isNets">
        <el-col :span="12">
          <el-form-item label="中心状态：" prop="procStatus">
            <el-select v-model="formData.procStatus" placeholder="中心状态" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PROCESSSTATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" v-if="!isNets">
        <el-col :span="24">
          <el-form-item label="备注：" prop="remarks">
            <el-input type="textarea" v-model="formData.remarks" placeholder="备注" maxlength="210" show-word-limit />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="24">
          <el-form-item label="拒绝信息：" prop="rejectInfo">
            <el-input
              type="textarea"
              v-model="formData.rejectInfo"
              placeholder="拒绝信息"
              maxlength="210"
              show-word-limit
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: "Details",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    isNets: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
      // 是否显示弹出层
      open: false,
    };
  },
  mounted() {},
  methods: {
    // 表单重置
    reset() {
      this.resetForm("detailsForm");
      // this.$set(this, "form", {});
    },
    // 关闭回掉
    // handleClose(done) {
    //   this.$confirm("确认关闭？")
    //     .then(_ => {
    //       this.reset();
    //       done();
    //     })
    //     .catch(_ => {});
    // },
    closeFn() {
      this.open = false;
    },
    show() {
      this.open = true;
    },

    cancel() {
      this.open = false;
      this.reset();
    },
  },
};
</script>
